import {MutationTree} from 'vuex';
import * as types from '@/store/mutation-types';

export default class SettingStore {
    public static initState: any = {
        notification: {
            say: true,
            say_img: true,
            gift: true,
        },
        SoundAndShock: {
            messageSound: true,
            messageShock: true,
            actionShock: false,
            girlsModel: false,
        },
        download: true,
    };

    public static state: any = SettingStore.initState;
    public static mutations: MutationTree<any> = {
        [types.SETTING_UPDATE_NOTIFICATION](state: any | any, notificationSetting: any) {
            state.notification = Object.assign(state.notification, notificationSetting);
        },
        [types.SETTING_UPDATE_SOUND_AND_SHOCK](state: any | any, SoundAndShock: any) {
            state.notification = Object.assign(state.SoundAndShock, SoundAndShock);
        },
        [types.SETTING_UPDATE_DOWNLOAD](state: any | any, download: boolean) {
            state = Object.assign(state, {download});
        },
    };
}
